#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>

using namespace std;

#define N 1000
#define E 100000
#define typec int // type of cost
const typec inf = 0x3f3f3f3f; // max of cost
struct edge { int x, y, nxt; typec c; } bf[E];
int ne, head[N], cur[N], ps[N], dep[N];
void addedge(int x, int y, typec c)
{ // add an arc(x -> y, c); vertex: 0 ~ n-1;
bf[ne].x = x; bf[ne].y = y; bf[ne].c = c;
bf[ne].nxt = head[x]; head[x] = ne++;
bf[ne].x = y; bf[ne].y = x; bf[ne].c = 0;
bf[ne].nxt = head[y]; head[y] = ne++;
}
typec flow(int n, int s, int t)
{
typec tr, res = 0;
int i, j, k, f, r, top;
while (1) {
memset(dep, -1, n * sizeof(int));
for (f = dep[ps[0] = s] = 0, r = 1; f != r; )
for (i = ps[f++], j = head[i]; j; j = bf[j].nxt)
{
if (bf[j].c && -1 == dep[k = bf[j].y]){
dep[k] = dep[i] + 1; ps[r++] = k;
if (k == t) { f = r; break; }
}
}
if (-1 == dep[t]) break;
memcpy(cur, head, n * sizeof(int));
for (i = s, top = 0; ; ) {
if (i == t) {
for (k = 0, tr = inf; k < top; ++k)
if (bf[ps[k]].c < tr)
tr = bf[ps[f = k]].c;
for (k = 0; k < top; ++k)
bf[ps[k]].c -= tr, bf[ps[k]^1].c += tr;
res += tr; i = bf[ps[top = f]].x;
}
for (j=cur[i]; cur[i]; j = cur[i] = bf[cur[i]].nxt)
if (bf[j].c && dep[i]+1 == dep[bf[j].y]) break;
if (cur[i]) {
ps[top++] = cur[i];
i = bf[cur[i]].y;
}
else {
if (0 == top) break;
dep[i] = -1; i = bf[ps[--top]].x;
}
}
}
return res;
}

struct Node
{
    int s, n, e, t;
};

struct Inv
{
    int x, y;
    Inv( ) { }
    Inv( int _x, int _y ) : x( _x ), y( _y ) { }
};

Node a[ 201 ];
int n, m, sum, nn;
vector<int> qj;
vector<Inv> inv;

void init( )
{
    int i, j;
    ne = 2;
    sum = 0;
    qj.clear( ); inv.clear( );
    memset( head, 0, sizeof( head ) );
    for ( i = 0; i < n; i++ )
    {
        scanf("%d%d%d%d", &a[ i ].s, &a[ i ].n, &a[ i ].e, &a[ i ].t);
        qj.push_back( a[ i ].s ); qj.push_back( a[ i ].e );
        sum += a[ i ].n * a[ i ].t;
        addedge( 0, i + 1, a[ i ].n * a[ i ].t );
    }
    sort( qj.begin( ), qj.end( ) );
    for ( i = 1; i < qj.size( ); i++ )
        if ( qj[ i ] != qj[ i - 1 ] )
            inv.push_back( Inv( qj[ i - 1 ], qj[ i ] ) );
    nn = inv.size( );
    for ( i = 0; i < nn; i++ )
        addedge( n + 1 + i, n + nn + 1, m * ( inv[ i ].y - inv[ i ].x ));
    for ( i = 0; i < n; i++ )
    {
        for ( j = 0; j < nn; j++ )
            if ( a[ i ].s <= inv[ j ].x && a[ i ].e >= inv[ j ].y )
                addedge( i + 1, n + 1 + j, inf );
    }
}

int main( )
{
    while ( scanf("%d%d", &n, &m) != EOF )
    {
        init( );
        if ( flow( n + nn + 2, 0, n + nn + 1 ) == sum )
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}
